package com.haoge7777.weblog.web.model;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

@Data
@ApiModel(value = "用户实体类")
public class User {

    //用户名
    @NotNull(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名")
    private String username;

    //用户性别
    @NotNull(message = "用户性别不能为空")
    @ApiModelProperty(value = "用户性别")
    private Integer sex;

    //用户年龄
    @NotNull(message = "用户年龄不能为空")
    @Min(value = 18,message = "用户年龄不能低于18岁")
    @Max(value = 100,message = "用户年龄不能超过100岁")
    @ApiModelProperty(value = "用户年龄")
    private Integer age;

    //用户邮箱号
    @NotNull(message = "用户邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @ApiModelProperty(value = "用户邮箱")
    private String email;

    //创建时间
    private LocalDateTime createTime;

    //更新日期
    private LocalDate updateDate;

    //时间
    private LocalTime time;



}
